package com.probiz.estore.order.service.impl;

import com.probiz.estore.common.model.order.OrderPick;
import com.probiz.estore.core.service.impl.GenericManagerImpl;
import com.probiz.estore.order.service.OrderPickManager;
import com.probiz.estore.order.dao.OrderPickDao;


/**
 * Manager implementation for OrderPick, responsible for business processing, and communicate between web and persistence layer.
 */
public class OrderPickManagerImpl extends GenericManagerImpl<OrderPick> implements OrderPickManager {

	private OrderPickDao orderPickDao = null;

	/**
	 * @param orderPickDao
	 *            the orderPickDao to set
	 */
	public void setOrderPickDao(OrderPickDao orderPickDao) {
		this.orderPickDao = orderPickDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.probiz.estore.core.service.impl.GenericManagerImpl#init()
	 */
	@Override
	protected void initManager() {
		dao = orderPickDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.probiz.estore.core.service.impl.GenericManagerImpl#preDelete(java.lang.Object)
	 */
	@Override
	protected void preDelete(OrderPick entity) {

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.probiz.estore.core.service.impl.GenericManagerImpl#preSave(java.lang.Object)
	 */
	@Override
	protected void preSave(OrderPick entity) {

	}
	/*
	 * (non-Javadoc)
	 * @see com.probiz.estore.order.service.OrderPickManager#getSizeByDocumentNo(java.lang.String)
	 */
	public Long getSizeByDocumentNo(String documentNo){
		return orderPickDao.countByHql("from OrderPick o where o.documentNo = ?", documentNo);
	}

}
